using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class Serial_NoMap : EntityTypeConfiguration<Serial_No>
    {
        public Serial_NoMap()
        {
            // Primary Key
            this.HasKey(t => t.No_ID);

            // Properties
            this.Property(t => t.No_Type)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.No_content)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.patient_id)
                .IsRequired()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("Serial_No");
            this.Property(t => t.No_ID).HasColumnName("No_ID");
            this.Property(t => t.No_Type).HasColumnName("No_Type");
            this.Property(t => t.No_content).HasColumnName("No_content");
            this.Property(t => t.To_ID).HasColumnName("To_ID");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.Create_Time).HasColumnName("Create_Time");
            this.Property(t => t.Update_Time).HasColumnName("Update_Time");
            this.Property(t => t.Ljsc).HasColumnName("Ljsc");
        }
    }
}
